package com.atguigu.spring.listener;

import org.springframework.boot.ConfigurableBootstrapContext;
import org.springframework.boot.SpringApplicationRunListener;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.core.env.ConfigurableEnvironment;

import java.time.Duration;

public class DemoAtguiguListener implements SpringApplicationRunListener {

    public void starting(ConfigurableBootstrapContext bootstrapContext) {
        System.out.println("☆☆☆starting...☆☆☆");
    }

    public void environmentPrepared(ConfigurableBootstrapContext bootstrapContext, ConfigurableEnvironment environment) {
        System.out.println("☆☆☆environmentPrepared...☆☆☆");
    }

    public void contextPrepared(ConfigurableApplicationContext context) {
        System.out.println("☆☆☆contextPrepared...☆☆☆");
    }

    public void contextLoaded(ConfigurableApplicationContext context) {
        System.out.println("☆☆☆contextLoaded...☆☆☆");
    }

    public void started(ConfigurableApplicationContext context, Duration timeTaken) {
        System.out.println("☆☆☆started...☆☆☆");
    }

    public void ready(ConfigurableApplicationContext context, Duration timeTaken) {
        System.out.println("☆☆☆ready...☆☆☆");
    }

    public void failed(ConfigurableApplicationContext context, Throwable exception) {
        System.out.println("☆☆☆failed...☆☆☆");
    }
    
}
